class Admin::SiteCategoriesController < Admin::AdminApplicationController
  layout "admin"
  before_filter :admin_login_required
  
  def index
    @site_categories = SiteCategory.paginate :order => "id ASC", :page => params[:page]
  end
  
  def show
    @site_category = SiteCategory.find(params[:id])
  end
  
  def new
   @site_category = SiteCategory.new(params[:site_category])
  end
  
  def create
    @site_category = SiteCategory.new(params[:site_category])
    @site_category.save
    redirect_to show_category_admin_site_url(@site_category)
  end
  
  def edit
    @site_category = SiteCategory.find(params[:id])
  end
  
  def update
    @site_category = SiteCategory.find(params[:id])
    @site_category.update_attributes(params[:site_category])
    redirect_to show_category_admin_site_url(@site_category)
  end
  
  def destroy
    SiteCategory.find(params[:id]).destroy
    redirect_to list_category_admin_sites_url
  end
end
